package br.com.gerenciamento.pg.repository.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;
import br.com.gerenciamento.pg.framework.jpa.model.AbstractPersistable;

@Entity
@Table(name = "GARBO_USUARIO")
@Getter @Setter
public class Usuario extends AbstractPersistable<Long> {

	private static final long serialVersionUID = 2972457449059869751L;

	@Id
	@SequenceGenerator(name="GR_USUARIO" , sequenceName="GARBO_USUARIO_SEQ" , allocationSize=1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="GR_USUARIO")
	@Column(name = "IDUSUARIO", updatable = false)
	private Long id;

	@Column(name = "IDENTIFICACAO", length = 14, nullable = false, unique = true)
	private String identificacao;

	@Column(name = "USERNAME", length = 20, nullable = false, unique = true)
	private String userName;
	
	@Column(name = "EMAIL", length = 200, nullable = false, unique = true)
	private String email;

}